﻿<html>
<head>
    <title>@ViewBag.Title</title>
    <meta charset="utf-8" />
    @RenderSection("styles", false)
    <link href="~/Public/libs/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/Public/libs/bootstrap/css/bootstrap-theme.css" rel="stylesheet" />
    <link href="~/Public/libs/Kendo/css/kendo.common.min.css" rel="stylesheet" />
    <link href="~/Public/libs/Kendo/css/kendo.bootstrap.css" rel="stylesheet" />    
</head>
<body>

    <nav class="navbar navbar-default">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="#">厦航应急管理指挥协调系统DEMO</a>
            </div>

            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav">
                    <li class="navbar-nav-li depart">
                        <a href="/department?active=depart">
                            组织机构
                            <span class="sr-only">(current)</span>
                        </a>
                    </li>
                    <li class="navbar-nav-li user"><a href="/user?active=user">人员信息</a></li>
                    <li class="navbar-nav-li post"><a href="/postinfo?active=post">岗位设置</a></li>
                    <li class="navbar-nav-li userCalc"><a href="/user/chart?active=userCalc">人员统计分析</a></li>
                </ul>

                <ul class="nav navbar-nav navbar-right">
                    <li><a href="/user/center">administrator</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">用户中心 <span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">退出登录</a></li>
                        </ul>
                    </li>
                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
    <div id="main-container" style="padding:0 20px;">
        @RenderBody()
    </div>
    @Scripts.Render("~/Public/libs/jquery/jquery-3.2.0.js")
    <script src="~/Public/libs/bootstrap/js/bootstrap.min.js"></script>
    @Html.Partial("~/Views/partials/_CommonJs.cshtml")
    @RenderSection("scripts", false)
    <script type="text/javascript">
        //根据QueryString参数名称获取值
        function getQueryStringByName(name) {
            var result = location.search.match(new RegExp("[\?\&]" + name + "=([^\&]+)", "i"));
            if (result == null || result.length < 1) {
                return "";
            }
            return result[1];
        }
        window.onload = function () {
            var active = getQueryStringByName("active");
            if (active) {
                var lis = document.getElementsByClassName("navbar-nav-li");
                for (var i = 0; i < lis.length; i++) {
                    var itemLi = lis[i];
                    $(itemLi).removeClass("active");
                }
                var activeLi = document.getElementsByClassName(active);
                $(activeLi).addClass("active");
            }
        }
    </script>

</body>
</html>
